package com.mars.btrace.demo;

import com.sun.btrace.AnyType;
import com.sun.btrace.BTraceUtils;
import com.sun.btrace.annotations.*;

/**
 * author by: mars
 * Date: 2019/5/25 22:56
 * Description: 拦截构造函数
 */
@BTrace
public class BtraceDemo2 {

    @OnMethod(
            clazz = "com.mars.btrace.pojo.User",
            method = "<init>"
    )
    public static void getConstruct(@ProbeClassName String pcn,
                                    @ProbeMethodName String pmn,
                                    AnyType[] args){
        BTraceUtils.println(pcn+","+pmn);
        BTraceUtils.printArray(args);
        BTraceUtils.println();
    }
}
